Skip to content

Add new CentriConnect component#166933

Draft
gresrun wants to merge 12 commits intohome-assistant:devfrom
gresrun:centriconnect
Draft

Add new CentriConnect component#166933
gresrun wants to merge 12 commits intohome-assistant:devfrom
gresrun:centriconnect

Conversation

@gresrun
Copy link
Copy Markdown

@gresrun gresrun commented Mar 31, 2026

Proposed change

Add a new component for CentriConnect/MyPropane tank monitors

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies a diff between library versions and ideally a link to the changelog/release notes is added to the PR description.

To help with the load of incoming pull requests:

Copilot AI review requested due to automatic review settings March 31, 2026 07:27
Copy link
Copy Markdown

@home-assistant home-assistant bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @gresrun

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@home-assistant
Copy link
Copy Markdown

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds a new CentriConnect/MyPropane component to Home Assistant that integrates tank monitoring devices through a cloud polling API. The integration provides a comprehensive sensor platform for monitoring tank levels, battery status, device location, and various diagnostics.

Changes:

  • Adds complete CentriConnect/MyPropane integration with config flow for device authentication
  • Implements 16 sensor entities with device information, tank metrics, and diagnostics
  • Includes coordinator for polling the CentriConnect API at 6-hour intervals
  • Provides diagnostics support for troubleshooting
  • Adds comprehensive test coverage with snapshot validation

Reviewed changes

Copilot reviewed 24 out of 30 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
homeassistant/components/centriconnect/sensor.py Main sensor platform with 16 entity descriptions for various device metrics
homeassistant/components/centriconnect/coordinator.py Data coordinator handling API polling and data normalization
homeassistant/components/centriconnect/config_flow.py Configuration flow for device authentication with error handling
homeassistant/components/centriconnect/init.py Integration setup and teardown
homeassistant/components/centriconnect/entity.py Base entity class with device info and unique ID generation
homeassistant/components/centriconnect/diagnostics.py Diagnostics endpoint for troubleshooting
tests/components/centriconnect/ Comprehensive test suite with snapshot tests and config flow tests
manifests/config files Integration manifest, quality scale, icons, strings, and requirements

gresrun added 2 commits March 31, 2026 01:50
Added suggested display precision to various sensor descriptions for better formatting.
@gresrun gresrun marked this pull request as ready for review March 31, 2026 08:10
Copilot AI review requested due to automatic review settings March 31, 2026 08:10
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 24 out of 30 changed files in this pull request and generated no new comments.

Copy link
Copy Markdown
Member

@joostlek joostlek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello!

Before the PR is reviewable, please remove the brand folder and diagnostics from the initial PR. The brands should be merged to our brands repository

@gresrun
Copy link
Copy Markdown
Author

gresrun commented Apr 3, 2026

Filed Brand PR: home-assistant/brands#10070

Copilot AI review requested due to automatic review settings April 3, 2026 05:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 21 out of 23 changed files in this pull request and generated 3 comments.

@gresrun gresrun marked this pull request as ready for review April 3, 2026 05:29
Copilot AI review requested due to automatic review settings April 3, 2026 05:29
@home-assistant home-assistant bot requested a review from joostlek April 3, 2026 05:29
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 21 out of 23 changed files in this pull request and generated 1 comment.

hass: HomeAssistant, entry: CentriConnectConfigEntry
) -> bool:
"""Unload CentriConnect/MyPropane API integration platforms and coordinator."""
_LOGGER.info("Unloading CentriConnect/MyPropane API integration")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to log IMO

Comment on lines +29 to +31
vol.Required(CONF_USERNAME): str,
vol.Required(CONF_DEVICE_ID): str,
vol.Required(CONF_PASSWORD): str,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need the device id?


async def async_step_user(
self, user_input: dict[str, Any] | None = None
) -> config_entries.ConfigFlowResult:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
) -> config_entries.ConfigFlowResult:
) -> ConfigFlowResult:

}


class CentriConnectConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
class CentriConnectConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
class CentriConnectConfigFlow(ConfigFlow, domain=DOMAIN):

Comment on lines +71 to +80
except CentriConnectConnectionError:
errors["base"] = "cannot_connect"
except CentriConnectTooManyRequestsError:
errors["base"] = "cannot_connect"
except CentriConnectNotFoundError:
errors["base"] = "invalid_auth"
except CentriConnectEmptyResponseError:
errors["base"] = "unknown"
except CentriConnectDecodeError:
errors["base"] = "unknown"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These duplicate ones can be merged

Comment on lines +135 to +152
CentriConnectSensorEntityDescription(
key=CentriConnectSensorType.LATITUDE,
translation_key=CentriConnectSensorType.LATITUDE,
native_unit_of_measurement=DEGREE,
state_class=SensorStateClass.MEASUREMENT,
entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=False,
value_fn=lambda coord: coord.data.latitude,
),
CentriConnectSensorEntityDescription(
key=CentriConnectSensorType.LONGITUDE,
translation_key=CentriConnectSensorType.LONGITUDE,
native_unit_of_measurement=DEGREE,
state_class=SensorStateClass.MEASUREMENT,
entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=False,
value_fn=lambda coord: coord.data.longitude,
),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why isn't lat/long/altitutde a device tracker?

Comment on lines +153 to +167
CentriConnectSensorEntityDescription(
key=CentriConnectSensorType.LTE_SIGNAL_LEVEL,
translation_key=CentriConnectSensorType.LTE_SIGNAL_LEVEL,
native_unit_of_measurement=PERCENTAGE,
state_class=SensorStateClass.MEASUREMENT,
entity_category=EntityCategory.DIAGNOSTIC,
suggested_display_precision=0,
value_fn=lambda coord: (
# The LTE signal level is estimated based on the LTE signal strength,
# with -140 dBm or below being 0% and -70 dBm or above being 100%.
min(1.0, max(((coord.data.lte_signal_strength + 140.0) / 70.0), 0.0)) * 100
if coord.data.lte_signal_strength is not None
else None
),
),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Either do in library
  2. I am not sure why we need a percentage as well

Comment on lines +291 to +301
async def async_setup_entry(
hass: HomeAssistant,
entry: CentriConnectConfigEntry,
async_add_entities: AddConfigEntryEntitiesCallback,
) -> None:
"""Set up CentriConnect sensor entities from a config entry."""
async_add_entities(
CentriConnectSensor(entry.runtime_data, description)
for description in ENTITIES
if description.value_fn(entry.runtime_data) is not None
)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have this under the entity descriptions but above the sensor

Comment on lines +90 to +97
CentriConnectSensorEntityDescription(
key=CentriConnectSensorType.BATTERY_LEVEL,
translation_key=CentriConnectSensorType.BATTERY_LEVEL,
native_unit_of_measurement=PERCENTAGE,
state_class=SensorStateClass.MEASUREMENT,
device_class=SensorDeviceClass.BATTERY,
entity_category=EntityCategory.DIAGNOSTIC,
value_fn=lambda coord: (
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by using the device class, you don't need all that logic for battery icons

Comment on lines +32 to +33
"critical_level": "Critical Level",
"low_level": "Low Level",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

our strings are in Sentence case

@home-assistant home-assistant bot marked this pull request as draft April 4, 2026 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants